package gui.visu.listeners;

import gui.utils.components.DisplayDataPopupWindow;
import gui.visu.components.popupdisplaydata.A_PopupDisplayData;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import controls.visu.A_DisplayDataControl;

/**
 * @author Charles Perin
 * 29 mars 2011
 * LIMSI - INRIA Rennes
 * charles.perin@free.fr
 *
 */
public abstract class A_ListenerPopupDisplayData implements MouseListener , MouseMotionListener{
	
	protected int xStart, xEnd, value;
	protected A_DisplayDataControl controler;
	protected A_PopupDisplayData popupDisplayData;

	public A_ListenerPopupDisplayData(A_DisplayDataControl controler, A_PopupDisplayData popupDisplayData){
		this.controler = controler;
		this.popupDisplayData = popupDisplayData;
	}
	
	
	@Override
	public void mouseDragged(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseMoved(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseClicked(MouseEvent e) {
		if(e.getButton()==MouseEvent.BUTTON1){
			if(e.getClickCount()==2){
				((popupDisplayData.getParent().getParent().getParent().getParent().getParent())).setEnabled(true);
				((DisplayDataPopupWindow)(popupDisplayData.getParent().getParent().getParent().getParent())).dispose();
			}
		}
	}

	@Override
	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}



	@Override
	public void mousePressed(MouseEvent e) {
		if(e.getButton()==MouseEvent.BUTTON1){
			System.out.println("button1");
			System.out.println(e.toString());
			xStart = e.getX();
			xEnd = e.getX();
		}
	}

	@Override
	public void mouseReleased(MouseEvent e) {

	}

}
